#ifndef _PPG_IGBT_CONTROL_H_
#define _PPG_IGBT_CONTROL_H_

#define C_PWL_SET 		50
#define C_PPG_DL 		24  //32 //32/8=4us 24/8=3us		//;16			;0x0.125uS=2uS
#define C_InitPPGT 		(512 - 10 * 16)
//-----------------highpower
#define MAX_PPG_WIDTH    30      //high power Software limit PPG maximum width,  unit:us                                        
#define MIN_PPG_WIDTH    8//2 		 //high power Software limit PPG minimum width,  unit:us
#define C_MaxPPGT 		(512 - MIN_PPG_WIDTH * 16)	
#define C_MinPPGT 		(512 - MAX_PPG_WIDTH * 16) 	
#define C_MaxLoadShedPPGT	(512 - 15 * 16)	//Maximum load shedding width
//-----------------lowpower
#define C_MaxPPGT_l 	(512 - 5 * 16)
#define C_MinPPGT_l 	(512 - 20 * 16) 
//-------------------
#define C_1600WPPGT 	(512 - 16 * 16)
#define C_SHAKE_FRQ 	50 //(60)

//-----------------PPG Pulse width limitation PWLT
#define PPGWIDTH_LIMIT_VALUE            50                                               

//-----------------PPG Non repeatable triggering
#define PPG_UN_REPETABLE_VALUE          12          // unit:us


#define C_PPGTMR1 		(256 - 128) // t0~t1
#define C_PPGTMR2 		(256 - 128) // t1~t2 128*32us=4096us
#define C_PPGTMR3 		(256 - 64)  // t2~t3 192*32us=6144us

#define IGBT_Off(void)       \
    {                        \
        _ppgc0 = 0b00000000; \
        bPowerState = 0;     \
    }


extern vu16 PPGTA_copy,PPGTA_Min;
				
    
void PPG_Config(void);
void IGBT_PowerOn(void);
void PowerOnProc(void);
void PowerOffProc(void);
void Adj_Power(void);


#endif